<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
		// 作业2：数组求差集/交集/并集
		
		var arr1 = [1,2,3,4,5];
		var arr2 = [3,4,5,6,7];
// 		
// 		差集：[1,2,6,7]
// 		交集：[3,4,5]
// 		并集：[1,2,3,4,5,6,7]
		
		function has(arr,ele){
			return arr.indexof(ele)==-1?  /* arr:数组。ele:查找的元素. */
			return arr.include(ele);	
		}
		console.log(has(arr1));
		console.log(has(arr2));
		
		
		
		
		
		
		
		var newArr = [];
		(arr1.includes(arr2[3]) == false) => newArr.push(arr2[i])
		(arr2.includes(arr1[3]) == false) => newArr.push(arr1[i])
		console.log(newArr);
		
		
		
		
		
		
		
		
		
		
		
		
		
	</script>	
	</head>
	<body>
	</body>
</html>
